#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <iostream>
#include <mili/mili.h>
#include "prot-filer/read_utils.h"

using namespace std;
using namespace prot_filer;

TEST(ReadUtilsTest, sizeof_in_bits)
{
    CompressedHelper h;
    int t = 0;
    ASSERT_EQ(sizeof(t) * 8, h.sizeof_in_bits(t));
}

TEST(ReadUtilsTest, physical)
{
    CompressedHelper h;
    ostringstream out;
    float t = 1;
    h.write_var(out, t);
    float r = 0;
    istringstream in(out.str());
    h.read_var(in, r);
    ASSERT_EQ(t, r);
}
